home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / What's New? / Development Kits / Mac OS / USB DDK 1.4.6f4 / Examples / USBEnetSample / EnetShim.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-23  |  1.7 KB  |  110 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        EnetShim.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 2000 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #ifndef    _ENETSHIM_
  13. #define    _ENETSHIM_
  14.  
  15. // Shim definitions etc.
  16.  
  17. typedef UInt32    ShimRefNum;
  18.  
  19. #define kInvalidRef        -1
  20.  
  21. #define Shim_Validate    "\pEnetMac_ValidateHW"
  22. #define Shim_Entry        "\pEnetMac_ShimEntry"
  23. #define Shim_Install    "\pEnetShimInstallDriver"
  24. #define Shim_Remove        "\pEnetShimRemoveDriver"
  25. #define Shim_Async        "\pEnetShimAsyncStatus"
  26.  
  27. // Shim interface structure(s)
  28.  
  29. typedef    struct    EnetShimInterface
  30. {
  31.     StringPtr            DRVName;
  32.     CFragConnectionID    ConnID;
  33.     UInt32                RefCon;
  34.     UInt32                theID;
  35.     
  36. } EnetShimInterface;
  37.  
  38. typedef struct USBEnet
  39. {
  40.     ShimRefNum             ioRefNum;
  41.     void                 *ioBuffer;
  42.     UInt32                 ioReqCount;
  43.     UInt32                 ioActCount;
  44.     ProcPtr             ioCompletion;
  45.     void                 *ioMisc;
  46.     OSErr                 ioResult;
  47.     
  48. } USBEnet;
  49. typedef USBEnet *USBEnetPtr;
  50.  
  51. // Hardware abstraction (selector) codes
  52.  
  53. enum
  54. {
  55.     EnetHAL_RegisterPorts        =    0,
  56.     
  57.     EnetHAL_Open                =    1,
  58.     EnetHAL_Close                =    2,
  59.     
  60.     EnetHAL_Start                =    3,
  61.     EnetHAL_Stop                =    4,
  62.     
  63.     EnetHAL_Read                =    5,
  64.     EnetHAL_Write                =    6,
  65.     
  66.     EnetHAL_GetMACAddress        =    7,
  67.     EnetHAL_SetMACAddress        =    8,
  68.     EnetHAL_SetMulticastFilters    =    9,
  69.     
  70.     EnetHAL_Status                =    10
  71.  
  72. };
  73.  
  74.  
  75. // statistics selector codes
  76. enum
  77. {
  78.     kTxFrames                = 1,
  79.     kRxFrames                = 2,
  80.     kTxErrors                = 3,
  81.     kRxErrors                = 4,
  82.     
  83.     kRxCRCErrors            = 5,
  84.     kTxQueueLength            = 6,
  85.     kRxAlignErrors            = 7,
  86.     kTxOneCollision            = 8,
  87.     
  88.     kTxMultipleCollision    = 9,
  89.     kTxDeferred                = 10,
  90.     kTxTooManyCollisions    = 11,
  91.     kRxOverrun                = 12,
  92.     
  93.     kTxUnderrun                = 13,
  94.     kNoCarrierSense            = 14,
  95.     kLateCollisions            = 15
  96.     
  97. };
  98.  
  99. // Driver abstraction (selector) codes
  100.  
  101. enum
  102. {
  103.     EnetShim_Link        =    0,
  104.     EnetShim_Speed        =    1,
  105.     EnetShim_Error        =    2
  106.  
  107. };
  108.  
  109. #endif
  110.